package part1.language_basis.part1.language_basis.day04.day04test;

import java.util.Scanner;

public class CommandBySwitch {
    public static void main(String[] args) {
        /**接收用户输入的命令，依据命令做不同的操作*/
        Scanner scanner = new Scanner(System.in);
        System.out.println("请选择功能：1.取款 2.存款 3.查询余额 0.退卡");
        int command = scanner.nextInt();
        switch (command){
            case 1:
                System.out.println("取款操作...");
                break;
            case 2:
                System.out.println("存款操作...");
                break;
            case 3:
                System.out.println("查询余额操作...");
                break;
            case 0:
                System.out.println("退卡成功");
                break;
            default:
                System.out.println("输入错误");
                break;
        }



        /**接收用户输入的命令，依据命令做不同的操作*/
        Scanner scanner1 = new Scanner(System.in);
        System.out.println("请选择功能： 1.取款 2.存款 3.查询余额 0.退卡");
        int command1 = scanner1.nextInt();
        switch (command1){
            case 1:
                System.out.println("取款操作...");
                break;
            case 2:
                System.out.println("存款操作...");
                break;
            case 3:
                System.out.println("查询余额操作...");
                break;
            case 0:
                System.out.println("退卡成功");
                break;
            default:
                System.out.println("输入错误");
                break;
        }
    }
}
